package com.whmskj.xjlhsc.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

/**
 * 维保计划表
 *
 * @author lk
 * @since 2025-06-10 08:57:31
 */
@Data
@TableName("ys_wb_plan")
@Schema(description = "维保计划查询参数实体")
public class WbPlan implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 维保计划ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelIgnore
    private Long maintenancePlanId;

    /**
     * 维保计划编码
     */
    @ExcelProperty(value = "维保计划编号")
    private String planNo;

    /**
     * 维保计划名称
     */
    @ExcelProperty(value = "维保计划名称")
    private String planName;

    /**
     * 车间
     */
    @Schema(description = "车间编码(码值SCW-shop)", example = "")
    @ExcelIgnore
    private Integer workshop;

    @ExcelProperty(value = "车间")
    @TableField(exist = false)
    private String workshopLabel;

    /**
     * 年月
     */
    @Schema(description = "年月(格式yyyyMM)", example = "2025-06")
    @ExcelProperty(value = "年月")
    private String ymDate;

    /**
     * 维保类型
     */
    @ExcelIgnore
    private Integer type;

    @ExcelProperty(value = "维保类型")
    @TableField(exist = false)
    private String typeLabel;

    /**
     * 维保项目
     */
    @Schema(description = "维保项目类型(码值SCWBXM)", example = "")
    @ExcelIgnore
    private Integer itemType;

    @ExcelProperty(value = "维保项目")
    @TableField(exist = false)
    private String itemTypeLabel;
    /**
     * 状态
     */
    @Schema(description = "状态(SCWBZT)", example = "")
    @ExcelIgnore
    private Integer state;

    @ExcelProperty(value = "状态")
    @TableField(exist = false)
    private String stateLabel;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 创建人code
     */
    @ExcelIgnore
    private String createUserCode;

    /**
     * 创建人名称
     */
    @ExcelProperty(value = "制订人")
    private String createUserName;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelIgnore
    private Date updateTime;

    /**
     * 修改人code
     */
    @ExcelIgnore
    private String updateUserCode;

    /**
     * 修改人名称
     */
    @ExcelIgnore
    private String updateUserName;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;


    /**
     * 计划详情
     */
    @TableField(exist = false)
    @ExcelIgnore
    private List<LinkedHashMap<String, Object>> planDetailList;

    /**
     * 修改提交时要删除的行索引
     */
    @TableField(exist = false)
    @ExcelIgnore
    List<Integer> deleteRowIndexList;

    /**
     * 分配信息
     */
    @TableField(exist = false)
    @ExcelIgnore
    private List<EquipmentMtnPlanAllocation> allocationList;
}
